﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<z.m.db.Messenger>" %>

<% if (ViewData["type"] == "header") {%>
	<tr>
		<td><%: Html.LabelFor(m=>m.ID) %></td>
		<td><%:Html.LabelFor(m=>m.Text)%></td>
		<td colspan="99">Controll</td>
	</tr>
<%} else if (ViewData["type"] == null) {%>
<tr id="ms<%:Model.ID%>" data-id="<%:Model.ID%>">
	<td>
		<input name="ID" readonly="true" type="text" value="<%:Model.ID %>" />
	</td>
	<td>
		<input name="Occasion_ID" value="<%:Model.Occasion_ID %>" type="text" class="collapse" />
		<div class="hidden" data-col="Text">
			<div class="close" onclick="closePopup(this.parentElement);destroyEditor();"></div>
			<textarea name="Text"><%:Model.Text %></textarea>
		</div>
		<input value="Text" type="button" onclick="showPopup('#ms<%:Model.ID%>	div[data-col=\'Text\']');installEditor('#ms<%:Model.ID%>	');" />
	</td>
	<td>
		<input type="button" value="<%:Model.ID==0?"Add":"Save" %>" onclick='ajaxTrSubmit(event);' />
	</td>
	<td>
		<input type="button" value="Delete" onclick='ajaxTrBtn(event,"Delete");' />
	</td>
</tr>
<%} else {%>
<%} %>